import Vue from 'vue'
import VueRouter from 'vue-router'
//一级路由
import UiRouter from '@/views/UiRouter.vue'
import Contacts from '@/views/Contacts.vue'
import About from '@/views/About.vue'
//二级路由
import AllCont from '@/views/second/AllCont.vue'
import Alice from '@/views/second/Alice.vue'
import Bob from '@/views/second/Bob.vue'
//三级路由
import Phone from '@/views/third/Phone.vue'
import Phone2 from '@/views/third/Phone2.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/uirouter',
      component: UiRouter
    },
    {
      path: '/contacts',
      component: Contacts,
      children: [
        {
          path: '/',
          redirect: 'allcont',
        },
        {
          path: 'allcont',
          component: AllCont,
        },
        {
          path: 'alice',
          component: Alice
        },
        {
          path: 'bob',
          component: Bob,
          children: [
            {
              path: 'phone',
              component: Phone
            },
            {
              path: 'phone2',
              component: Phone2
            },
          ]
        },
      ]
    },
    {
      path: '/about',
      component: About
    }
  ]
})

export default router